home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 26.zip
/
BS1 part 26
/
C for beginners.adf
/
source
/
fprint-fscan.c
< prev
next >
Wrap
C/C++ Source or Header
|
1978-01-17
|
542b
|
26 lines
/*fprint-fscan.c 23.2.1 */
#include <stdio.h>
main()
{
FILE *input, *output, *fopen();
char filename[81], text[200];
printf("Please input file name!\n");
scanf("%80s", filename);
printf("Input a (long) word!\n");
scanf("%200s", text);
output = fopen(filename, "w");
printf("Filehandle %d\n", output);
fprintf(output, "%s", text);
fclose(output);
input = fopen(filename, "r");
printf("Filehandle %d\n", input);
fscanf(input, "%200s", text);
fclose(input);
printf("The Text: >%s<\n", text);
}